<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>学生添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="icon" href="images/logome.ico">
    <link rel="stylesheet" href="lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="css/public.css" media="all">
     <link rel="stylesheet" href="js/lay-module/step-lay/step.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
		 <form th:action="@{/doStudentAdd}"  th:method="post">
		 							
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">教师工号 :</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="teacherNumber" lay-verify="required" 
                                            lay-reqtext="学生学号不能为空"  placeholder="请填写入学生学号" class="layui-input"
                                            onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" required />
                                            <tip>学号只能是阿拉伯数字</tip>
                                        </div>
                                    </div>
                                     <div class="layui-form-item">
                                        <label class="layui-form-label">教师姓名:</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="请填写入学生姓名" class="layui-input" name="teacherName"
                                              required />
                                        </div>
                                    </div>
                                   <div class="layui-form-item">
                                        <label class="layui-form-label">教师性别:</label>
                                        <div class="layui-input-block">
                                            <select lay-verify="required" name=teacherSex>
                                                <option value="男" selected>男</option>
                                                <option value="女">女</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">教师年龄:</label>
                                        <div class="layui-input-block">
                                            <input type="text" id="studentSexNumber" placeholder="请填写入学生年龄" class="layui-input" name="teacherAge"
                                              required />
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
					                    <label class="layui-form-label">添加日期</label>
					                    <div class="layui-input-block">
					                        <input type="text" name="createTime"  id="date" lay-verify="date"
					                         placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" required>
					                    </div>
					                </div>
					    <div class="layui-form-item">
					        <div class="layui-input-block">
					        	<a th:href="@{/teacherList}"><button type="button" class="layui-btn layui-btn-primary pre">上一步</button></a>
					            <button class="layui-btn layui-btn-normal"  lay-filter="saveBtn" type="submit">确认保存</button>
					        </div>
					    </div>
					    <p id="msg" th:text="${msg}" th:if="${! #strings.isEmpty(msg)}" 
                                style="text-align:center;color:red;font-size:18px;margin-top:30px;margin-bottom:20px;"></p>
        </form>
</div> 
<script src="lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script src="js/date.js" charset="utf-8"></script>
<script type="text/javascript">
var text = document.getElementById("studentSexNumber");
text.onkeyup = function(){
this.value=this.value.replace(/\D/g,'');
if(text.value>100){
  text.value = 100;
}
}
</script>
</body>
</html>
</body>
</html>